package com.zhyl.demo.mapper;

import com.zhyl.demo.entity.Appointment;
import org.apache.ibatis.annotations.Mapper;

import java.util.ArrayList;
import java.util.Date;

/**
 * @author yang3
 */
@Mapper
public interface AppointmentMapper {
    ArrayList<Appointment> loadAppointments(Integer patid);

    /**
     * 提交新预约
     * @param appointment
     * @return
     */
    Integer newAppointment(Appointment appointment);

    /**
     * 得到某位医生在当前日期下的所预约人数
     * @param docId
     * @param time
     * @return
     */
    Integer getNowDayAppointment(int docId, String time);

    /**
     * 获取预约详情
     * @param id
     * @return
     */
    Appointment getAppointmentDetail(int id);

    /**
     * 修改预约详情
     * @param appointment
     * @return
     */
    Integer updateAppointmentDetail(Appointment appointment);

    /**
     * 获取某位医生下的所有预约信息
     * @param docId
     * @return
     */
    ArrayList<Appointment> getDocAppointment(int docId);

    /**
     * 完成预约流程
     * @param appointmentId
     * @return
     */
    Integer completeAppointment(int appointmentId);

    /**
     * 叫号病人
     * @param id
     * @return
     */
    Integer callPatient(int id);

    /**
     * 取消叫号
     * @param id
     * @return
     */
    Integer cancelCall(int id);

    /**
     * 查看当前叫号人数
     * @param docId
     * @return
     */
    Integer checkCall(int docId);

    /**
     * 查询该医生名下所有预约
     * @param docId
     * @return
     */
    ArrayList<Appointment> selectByDoc(int docId);

    /**
     * 通过医生id与患者id查询出对应的list列表
     * @param patId
     * @param docId
     * @return
     */
    ArrayList<Appointment> searchPatient(Integer patId, int docId);

    /**
     * 取消预约
     * @param appointmentId
     * @return
     */
    Integer cancelAppointment(int appointmentId);

    /**
     * 删除预约
     * @param appointmentId
     * @return
     */
    Integer deleteAppointment(int appointmentId);

    Integer huayan(Integer appointmentId);
}
